/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ControlLayer;
import ModelLayer.*;


/**
 *
 * @author Thomas
 */
public class OrdreRegisterCtrl {
   
    private OrdreRegister ordreRegister;
    private Ordre ordre;
    
    /**
     * Constructor for objects of class OrdreRegisterCtrl
     */
    public OrdreRegisterCtrl()
    {
        // initialise instance variables
        ordreRegister = OrdreRegister.getInstance();
       
    }
    
    public void opretOrdre(int ordreID, String Dato)
    {
        ordre o = new Ordre(ordreID, Dato);
        ordreRegister.addOrdre(o);
    }        
    
     /**
     * Finds a Owner
     * @return Returns an object of type Owner
     */
    public Ordre findOrdre(int ordreId)
    {
        Ordre o = null;
        if(ordreRegister.findOrdre(ordreId) != null)
        {
            o = ordreRegister.findOrdre(ordreId);
        }
        else
        {
            System.out.println("No match found!");
        }
        return o;
    }
    
     public Ordre findKunde(int tlf)
    {
        Kunde k = null;
        if(ordreRegister.findKunde(tlf) != null)
        {
            k = ordreRegister.findKunde(tlf);
        }
        else
        {
            System.out.println("No match found!");
        }
        return k;
    }
     
     public void opdaterOrdre(int ordreId)
     {
         findOrdre(ordreId);
         
     }
     
     public void sletOrdre(int ordreId)
     {
         ordreRegister.sletOrdre(ordreId);
     }
     
     public void udskrivOrdre()
     {
         
     }  
    
}
